package de.kraenksoft.android.cinemaExample.model;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import de.kraenksoft.android.cinemaExample.utils.DateUtil;

public class Movie {
	private String name;
	private String description;
	private List<Screening> screenings = new ArrayList<Screening>();

	public List<Screening> getScreenings() {
		return screenings;
	}
	
	public List<Screening> getScreeningsByDate(Date date) {
		List<Screening> result = new ArrayList<Screening>();
		for (Screening screening:screenings){
			if (DateUtil.datesOnSameDay(date, screening.getStartTime())){
				result.add(screening);
			}
		}
		return result;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
	
	public void addScreening(Screening screening){
		screenings.add(screening);
	}
}
